package cn.hw.learn.inter.design.demo;

import org.jeewx.api.mp.aes.AesException;

import java.io.IOException;
import java.io.PrintWriter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import com.qq.weixin.mp.aes.AesException;
//import com.qq.weixin.mp.aes.SHA1;


/**
 * Servlet implementation class test
 */
@WebServlet("/test")
public class test extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public test() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //// TODO Auto-generated method stub
        //
        //String signature = request.getParameter("signature");
        //String timestamp = request.getParameter("timestamp");
        //String nonce = request.getParameter("nonce");
        //String echostr = request.getParameter("echostr");
        //String token = "somelog";//这里填基本配置中的token
        //String jiami = "";
        //try {
        //    jiami = getSHA1(token, timestamp, nonce, "");//这里是对三个参数进行加密
        //} catch (AesException e) {
        //    e.printStackTrace();
        //}
        //System.out.println("加密" + jiami);
        //System.out.println("本身" + signature);
        //PrintWriter out = response.getWriter();
        //if (jiami.equals(signature))
        //    out.print(echostr);

    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub

    }


}